import React from 'react'
import { Space, Tag, Col, Row, Divider, Table } from 'antd';
export default function DeviceData() {
  const columns = [
    {
      title: '序号',
      dataIndex: 'index',
      key: 'index',
      align: "center",
      width: "10%",
      render: (text, record, index) => {
        return <span style={{ fontSize: "12px" }}>{index + 1}</span>
      }
    },
    {
      title: '设备名称',
      dataIndex: 'devicename',
      key: 'devicename',
      align: "center",
      render: (text) => {
        return <span style={{ fontSize: "12px" }}>{text}</span>
      }
    },
    {
      title: '数据值',
      dataIndex: 'devicedata',
      key: 'devicedata',
      align: "center",
      render: (text) => {
        return <span style={{ fontSize: "12px" }}>{text}</span>
      }
    },
    {
      title: '设备类型',
      dataIndex: 'devicetype',
      key: 'devicetype',
      align: "center",
      render: (text) => {
        return <span style={{ fontSize: "12px" }}>{text}</span>
      }
    },
    {
      title: '操作',
      dataIndex: 'operate',
      key: 'operate',
      fixed: 'right',
      align: "center",
      render: (text, item) => {
        return <Space>
          <a style={{ fontSize: "12px", color: "#4e9dfd" }} >删除</a>
        </Space>
      }
    }
  ];
  const data = [
    {
      key: '1',
      id: '1',
      devicename: "温度传感器",
      devicedata: "20",
      devicetype: "传感器",
    },
    {
      key: '2',
      id: '2',
      devicename: "温度传感器",
      devicedata: "20",
      devicetype: "传感器",
    },
    {
      key: '3',
      id: '3',
      devicename: "温度传感器",
      devicedata: "20",
      devicetype: "传感器",
    },
    {
      key: '4',
      id: '4',
      devicename: "温度传感器",
      devicedata: "20",
      devicetype: "传感器",
    },
    {
      key: '5',
      id: '5',
      devicename: "温度传感器",
      devicedata: "20",
      devicetype: "传感器",
    },
    {
      key: '5',
      id: '5',
      devicename: "温度传感器",
      devicedata: "20",
      devicetype: "传感器",
    },
    {
      key: '5',
      id: '5',
      devicename: "温度传感器",
      devicedata: "20",
      devicetype: "传感器",
    }

  ]
  return (
    <div>
      <Table
        rowKey={(item) => item.id}
        columns={columns} dataSource={data}
        pagination={{ pageSize: 10 }}
        size='small'
      />
    </div>
  )
}
